# filename: AutoTraceDraw.py

import turtle as t
t.title('自动轨迹绘制')
t.setup(800, 600, 0, 0)
t.pencolor('red')
t.pensize(5)

# 数据读取
data_s = []
f = open('data.txt')
for line in f:
    line = line.replace('\n', '')
    data_s.append(list(map(eval, line.split(","))))
f.close()

# 自动绘制
for i in range(len(data_s)):
    t.pencolor(data_s[i][3], data_s[i][4], data_s[i][5])
    t.fd(data_s[i][0])
    if data_s[i][1]:
        t.right(data_s[i][2])
    else:
        t.left(data_s[i][2])
